{extend name="public:adminbase" /}
{block name="content"}


<div class="container-fluid p-t-15">

  <div class="row">
    <div class="col-lg-12">
      <div class="card">
        <ul class="nav nav-tabs page-tabs">
          {include file="AdminSetting/nav"}
        </ul>
        <div class="tab-content">
          <div class="tab-pane active">

            <form onsubmit="return false;" method="post" name="edit-form" class="edit-form">

              <div class="form-group">
                <label class="btn-block" for="web_site_status">自动提交</label>
                <div class="example-box">
                  <label class="lyear-radio radio-inline radio-primary">
                    <input type="radio" name="autopushststus" value="1"
                           {if config('baiduzhanzhang.autopushststus') == 1}checked{/if}><span>开启</span>
                  </label>
                  <label class="lyear-radio radio-inline radio-primary">
                    <input type="radio" name="autopushststus" value="0"
                           {if config('baiduzhanzhang.autopushststus') == 0}checked{/if}><span>关闭</span>
                  </label>
                </div>
                <small class="help-block">config('baiduzhanzhang.autopushststus')开启添加文章自动提交百度站长平台[新文章添加后，自动触发百度站长url提交]</small>
              </div>

              <div class="form-group">
                <label for="web_site_title">接口调用地址</label>
                <input class="form-control"
                       type="text"
                       id="web_site_title"
                       name="url"
                       value="{:config('baiduzhanzhang.url')}"
                       placeholder="请输入站点标题" >
                <small class="help-block">调用方式：<code>config('baiduzhanzhang.url')</code></small>
                <a href="https://micuer.com/new/448.html" target="_blank" class="btn btn-xs btn-primary">如何获取</a>
              </div>

              <div class="form-group">
                <button type="submit" onclick="formsub()" class="btn btn-primary m-r-5">确 定</button>
                <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);return false;">返 回</button>
              </div>
            </form>

          </div>
        </div>

      </div>
    </div>

  </div>

</div>
{include file="public/afooter"}
<script>

  function formsub() {
    var data = $("form").serialize();
    var url = "{:url('AdminSetting/baidu')}"
    $.post(url,data,function (e) {
      if(e.code != 200){
        error(e.msg);
      }else {
        success(e.msg);
        setTimeout(location.reload(), 1000);

      }
    })
  }

</script>
{/block}